<include file="Public/header" />
<include file="Public/menu" />

<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
            店铺订单
            <small>订单详细</small>
        </h1>

    </section>

    <!-- 内容 -->

    <section class="content"><div class="row"><div class="col-md-12"><div class="nav-tabs-custom">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#tab_0" data-toggle="tab">订单详情</a></li>
            <li><a href="{:U('orders/orderMark',array('id'=>$orDetail['product'][0]['order_id']))}" >订单备注</a></li>
            <li><a href="{:U('orders/orderLog',array('id'=>$orDetail['product'][0]['order_id']))}" >订单日志</a></li>
            <li class="pull-right header">
            </li></ul>
        <div class="tab-content">
            <div class="tab-pane active" id="tab_0">
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title">编辑：订单号[{$orDetail['product'][0]['order_id']}]</h3>

                        <div class="box-tools">

                            <!--<?php echo !empty($storeData['local_id']) ? $storeData['local_id'] :$_GET['local_id'];?>-->
                            <div class="btn-group pull-right" style="margin-right: 10px">
                                <a href="{:U('/Admin/Orders/orderList',['view'=>I('view')])}"   class="btn btn-sm btn-warning item_delete"><i class="fa fa-list"></i>&nbsp;返回上一页</a>
                            </div>
                        </div>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->

                        <div class="box-body">

                            <div class="form-group">



                                <table class="table table-hover" style="margin-left: 10px; width: 99%;">
                                    <tbody>
                                    <tr>
                                        <th>商品货号</th>
                                        <th>货品名称</th>
                                        <th>商品条形码</th>
                                        <th>已发货量</th>
                                        <th>单价</th>
                                        <th>购买数量</th>
                                        <th>合计金额</th>
                                    </tr>

                                <volist name="orDetail.product" id="item">
                                    <tr>
                                        <td>{$item.bn}</td>
                                        <td>{$item.name}</td>
                                        <td>{$item.barcode}</td>
                                        <td>{$item.sendnum}</td>
                                        <td>￥{$item.price|number_format=###, 2, '.', ''}</td>
                                        <td>{$item.nums}</td>
                                        <td>￥{$item.amount|number_format=###, 2, '.', ''} </td>

                                    </tr>
                                </volist>
                                    </tbody></table>


                                <div class="box-footer"></div>

                            </div>

                            <if condition="$isrefund neq NULL">
                            <div class="form-group">


                                <div class="box-header with-border">
                                    <h3 class="box-title" style="color: #ff0000">[客户申请（发货前：退款）]</h3>
                                </div>
                                <table class="table table-hover" style="margin-left: 10px; width: 99%;">
                                    <tbody>
                                    <tr>
                                        <th>&nbsp;</th>
                                        <th>商品货号</th>
                                        <th>货品名称</th>
                                        <th>商品条形码</th>
                                        <th>已发货量</th>
                                        <th>单价</th>
                                        <th>购买数量</th>
                                        <th>申请退款|退货退款数量</th>
                                    </tr>

                                    <volist name="isrefund" id="item">
                                        <tr>
                                            <td>{$item.istype}</td>
                                            <td>{$item.bn}</td>
                                            <td>{$item.name}</td>
                                            <td>{$item.barcode}</td>
                                            <td>{$item.sendnum}</td>
                                            <td>￥{$item.price|number_format=###, 2, '.', ''}</td>
                                            <td>{$item.nums}</td>
                                            <td>{$item.num}</td>
                                        </tr>
                                    </volist>
                                    <tr>
                        <td colspan="7"><h4 style="color: #FF0000;">退款金额:￥{$item.backprice|number_format=###, 2, '.', ''}</h4> </td>
                                    </tr>
                                    </tbody></table>


                                <div class="box-footer"></div>

                            </div>
                        </if>

                            <if condition="$isrefundtwo neq NULL">
                                <div class="form-group">


                                    <div class="box-header with-border">
                                        <h3 class="box-title" style="color: #ff0000">[客户申请（发货后退款商品）]</h3>
                                    </div>
                                    <table class="table table-hover" style="margin-left: 10px; width: 99%;">
                                        <tbody>
                                        <tr>
                                            <th>&nbsp;</th>
                                            <th>商品货号</th>
                                            <th>货品名称</th>
                                            <th>商品条形码</th>
                                            <th>已发货量</th>
                                            <th>单价</th>
                                            <th>购买数量</th>
                                            <th>申请退款|退货退款数量</th>
                                        </tr>

                                        <volist name="isrefundtwo" id="item">
                                            <tr>
                                                <td>{$item.istype}</td>
                                                <td>{$item.bn}</td>
                                                <td>{$item.name}</td>
                                                <td>{$item.barcode}</td>
                                                <td>{$item.sendnum}</td>
                                                <td>￥{$item.price|number_format=###, 2, '.', ''}</td>
                                                <td>{$item.nums}</td>
                                                <td>{$item.num}</td>

                                            </tr>
                                        </volist>
                                        <tr>
                 <td colspan="7"><h4 style="color: #FF0000;">退款金额:￥{$item.backprice|number_format=###, 2, '.', ''}</h4> </td>
                                        </tr>
                                        </tbody></table>


                                    <div class="box-footer"></div>

                                </div>
                            </if>

                            <if condition="$isrefundtree neq NULL">
                                <div class="form-group">


                                    <div class="box-header with-border">
                                        <h3 class="box-title" style="color: #ff0000">[客户申请（退货退款商品）]</h3>
                                    </div>
                                    <table class="table table-hover" style="margin-left: 10px; width: 99%;">
                                        <tbody>
                                        <tr>
                                            <th>&nbsp;</th>
                                            <th>商品货号</th>
                                            <th>货品名称</th>
                                            <th>商品条形码</th>
                                            <th>已发货量</th>
                                            <th>单价</th>
                                            <th>购买数量</th>
                                            <th>申请退款|退货退款数量</th>

                                        </tr>

                                        <volist name="isrefundtree" id="item">
                                            <tr>
                                                <td>{$item.istype}</td>
                                                <td>{$item.bn}</td>
                                                <td>{$item.name}</td>
                                                <td>{$item.barcode}</td>
                                                <td>{$item.sendnum}</td>
                                                <td>￥{$item.price|number_format=###, 2, '.', ''}</td>
                                                <td>{$item.nums}</td>
                                                <td>{$item.num}</td>

                                            </tr>
                                        </volist>
                                        <tr>
                     <td colspan="7"><h4 style="color: #FF0000;">退款金额:￥{$item.backprice|number_format=###, 2, '.', ''}</h4> </td>
                                        </tr>
                                        </tbody></table>


                                    <div class="box-footer"></div>

                                </div>
                            </if>



                            <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                                <div class="row"><div class="col-sm-6"></div><div class="col-sm-6"></div></div>
                                <div class="row"><div class="col-sm-12">
                   <table id="example2" class="table table-bordered table-hover dataTable" role="grid" aria-describedby="example2_info">
                                <thead>
                                <tr role="row">
                                    <th class="sorting_asc" tabindex="0"  rowspan="1" colspan="1">商品价格</th>
                                    <th class="sorting" tabindex="0" rowspan="1" colspan="1" >订单其他信息</th>
                                    <th class="sorting" tabindex="0" rowspan="1" colspan="1" >收货人信息</th>

                                </thead>
                                <tbody>


                                <tr role="row" class="odd">
                                    <td class="sorting_1">商品总额 :￥{$orDetail['detail']['cost_item']|number_format=###, 2, '.', ''}</td>
                                    <td>配送方式：{$orDetail['product'][0]['shipping']}</td>
                                    <td>姓名:{$orDetail['detail']['ship_name']}</td>
                                </tr>
                                <tr role="row" class="odd">
                                    <td class="sorting_1">配送费用 ：￥{$orDetail['detail']['cost_freight']|number_format=###, 2, '.', ''}</td>
                                    <td>商品重量：{$orDetail['detail']['weight']}</td>
                                    <td>手机:{$orDetail['detail']['ship_mobile']}</td>

                                </tr>
                                <tr role="row" class="odd">
                                    <td class="sorting_1">优惠抵扣金额 ：￥{$orDetail['detail']['youhui']|number_format=###, 2, '.', ''}</td>
                                    <td>支付方式:{$orDetail['detail']['payment']}<span style="color: #FF0000">[{$orDetail['detail']['is_zhifu']}]</span></td>
                                    <td>地区:{$orDetail['detail']['ship_area']}</td>

                                </tr>
                                <tr role="row" class="odd">
                                    <td class="sorting_1">奖金抵扣金额 : ￥{$orDetail['detail']['bonus_pay']|number_format=###, 2, '.', ''}</td>
                                    <td></td>
                                    <td></td>
                                </tr>
                                <tr role="row" class="odd">
                                    <td class="sorting_1">订单总额 : ￥{$orDetail['detail']['total_amount']|number_format=###, 2, '.', ''}</td>
                                    <if condition="$orDetail['detail']['is_zt'] eq 1">
                                        <td>自提电话：<span style="color: #ff0000">{$orDetail['detail']['pickedup_bn']}</span></td>
                                   <else/>
                                        <td></td>
                                    </if>
                                    <td>地址:{$orDetail['product'][0]['ship_addr']}</td>

                                </tr>
                                <tr role="row" class="odd">
                                    <!--<td class="sorting_1">已支付金额 : ￥{$orDetail['detail']['payed']|number_format=###, 2, '.', ''}</td>
                                    <td></td>-->
                                    <td colspan="3">发货日期：{$orDetail['detail']['ship_time']}</td>
                                </tr>
                                <tr role="row" class="odd">

                                    <td colspan="3">客户下单附言:{$orDetail['detail']['memo']}</td>
                                </tr>
                                <tr role="row" class="odd">

                  <td colspan="3">
                      <div style="text-align: center; ">
                        {$butt}
                      </div>

                  </td>
                                </tr>


                                </tbody>
                                <tfoot>

                                </tfoot>
                            </table></div></div></div>


                        </div>


                        <!-- /.box-body -->

                        <!-- /.box-footer -->

                </div>


            </div>
            <div class="tab-pane " id="tab_1">


                <form action="remarkOrder" method="post" accept-charset="UTF-8" class="form-horizontal" pjax-container="">


                    <div class="box-body">

                        <div class="form-group 1">


                            <table class="table table-hover" style="margin-left: 10px; width: 99%;">
                                <tbody>
                                <tr>
                                    <th>备注操作员</th>
                                    <th>备注内容</th>
                                    <th>时间</th>
                                </tr>



                                </tbody></table>


                            <label for="text" class="col-sm-2 control-label">订单备注：</label>

                            <div class="col-sm-6">
                                <textarea id="text" name="mark" class="form-control" rows="10" placeholder="备注"></textarea>
                                <input type="hidden" value="{$orDetail['product'][0]['order_id']}"  name='order_id'>
                            </div>
                        </div>


                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer">
                      <div class="col-sm-2">

                    </div>
                        <div class="col-sm-6">

                            <div class="btn-group pull-right">
                                <button type="submit" class="btn btn-info pull-right">保存</button>
                            </div>

                            <div class="btn-group pull-left">
                                <input type="reset" class="btn btn-warning" value="清空">
                            </div>

                        </div>

                    </div>
                    <!-- /.box-footer -->
                </form>



            </div>




        </div>
    </div></div></div>

    </section>




</div>
<!-- 底部 -->
<include file="Public/common_footer" />
<script src="/Public/layer/layer.js"></script>


<script data-exec-on-popstate>

    $(function () {



        $('.suggest').on('click', function(){

            var dataId = $(this).data('id');

            layer.ready(function(){
                layer.open({
                    type: 2,
                    title: '订单管理',
                    fix: false,
                    maxmin: true,
                    shadeClose: true,
                    area: ['1000px', '750px'],
                    content: dataId,
                    end: function(){
                        layer.tips('Hi', '#about', {tips: 1})
                    }
                });
            });
        });

        $('.grid-select-all').change(function() {
            if (this.checked) {
                $('.grid-item').prop("checked", true);
            } else {
                $('.grid-item').prop("checked", false);
            }
        });

        $('.batch-delete').on('click', function() {
            var selected = [];
            $('.grid-item:checked').each(function(){
                selected.push($(this).data('id'));
            });

            if (selected.length == 0) {
                return;
            }

            if(confirm("Are you sure to delete this item ?")) {
                $.post('/admin/auth/roles/' + selected.join(), {_method:'delete','_token':'ALpaP7hXZ6s2dnAdE02Z6mUSHPt8RkYbcDRp6rpw'}, function(data){
                    $.pjax.reload('#pjax-container');
                    noty({
                        text: "<strong>Succeeded!</strong>",
                        type:'success',
                        timeout: 1000
                    });
                });
            }
        });
    });
</script>